﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddAdminUser.aspx.cs" Inherits="AdminManagement_AddAdminUser" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title> 添加管理员</title>
    <link href="../Css/ys.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        function ddlChanged() {
            var ddl = document.getElementById("rbtnListType");
            if (ddl.options[ddl.selectedIndex].value == "0") {
                document.getElementById("ddlSchoolList").disabled = true;
            }
            else {
                document.getElementById("ddlSchoolList").disabled = false;
            }
        }

//        function CheckInfo() {
//            var ddlUserType = document.getElementById("rbtnListType");
//            var ddlSchool=document.getElementById("ddlSchoolList");
//            if (ddlUserType.options[ddlUserType.selectedIndex].value == '1' &&
//            ddlSchool.options[ddlSchool.selectedIndex].value=='0') {
//                alert("请先选择学校！");
//                return false;
//            }
        //        }
        // OnClientClick = "return CheckInfo();"按钮的客户端验证
    </script>
 <script language="javascript" type="text/javascript" src="../Js/LoginNameCheck.js"></script>
</head>
<body>
     <form id="form1" runat="server">
    <asp:HiddenField ID="hidId" runat="server" />
    <div class="zt mainCenter">
        <div class="contentBody">
            <div class="title">
               管理员管理-->新添管理员</div>
            <br class="sp3px" />
            <table style="width:100%;color:#336699;"  class="ta1">
        <tr>
            <td class="ta2 tag">
                登陆名：</td>
            <td class="ta2">
                <asp:TextBox ID="txtUname" runat="server"  ValidationGroup="register" 
                    CssClass="inp1" onblur="CreateActiveXobjectAdminLogin(this.value);" 
                    Height="21px" Width="126px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Text="*"  ControlToValidate="txtUname"
                 ErrorMessage="登陆名不能为空" ValidationGroup="register"></asp:RequiredFieldValidator><label id ="lblname" style ="color:Red; font-size:small"></label>
                </td>
        </tr>
        <tr><td class="ta2 tag"> 真实姓名:</td>
        <td class="ta2">
            <asp:TextBox ID="realname" runat="server" CssClass="inp1" Height="24px" 
                Width="126px"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" Text="*"  ControlToValidate="realname"
                 ErrorMessage="真实姓名不能为空" ValidationGroup="register"></asp:RequiredFieldValidator><label id ="Label1" style ="color:Red; font-size:small"></label></td></tr>
        <tr>
            <td class="ta2 tag">
                密码：</td>
            <td class="ta2">
                <asp:TextBox ID="txtpwd" runat="server"  TextMode="Password"  CssClass="inp1"
                    ValidationGroup="register" Height="21px" Width="126px" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Text="*"  ControlToValidate="txtpwd" 
                ErrorMessage="密码不能为空" ValidationGroup="register"></asp:RequiredFieldValidator>
                </td>
        </tr>
         <tr>
            <td class="ta2 tag">
                再次输入密码：</td>
            <td class="ta2">
                <asp:TextBox ID="txtagain" runat="server" TextMode="Password"  CssClass="inp1"
                    ValidationGroup="register" Height="20px" Width="126px"></asp:TextBox>
                <asp:CompareValidator ID="comValidator" runat="server" ControlToCompare="txtpwd" ControlToValidate="txtagain"
                 ErrorMessage="两次密码不一致" Text ="*" ValidationGroup="register"></asp:CompareValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" Text="*"  ControlToValidate="txtagain" 
                ErrorMessage="确认密码不能为空" ValidationGroup="register"></asp:RequiredFieldValidator>
                </td>
        </tr>
        
        <tr>
            <td class="ta2 tag">
                电子邮件：</td>
            <td class="ta2">
                <asp:TextBox ID="txtemail" runat="server" ValidationGroup="register" 
                    CssClass="inp1" Height="20px" Width="126px"></asp:TextBox>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" 
                 ControlToValidate="txtemail" runat="server" ErrorMessage="电子邮件地址不正确" 
                 ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="register" Text="*" ></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" Text="*"  ControlToValidate="txtemail" 
                ErrorMessage="电子邮件不能为空" ValidationGroup="register"></asp:RequiredFieldValidator>
                </td>
        </tr>
        <tr>
            <td class="ta2 tag">
                联系方式：</td>
            <td class="ta2">
                <asp:TextBox ID="txttelephone" runat="server" ValidationGroup="register" 
                   CssClass="inp1" Height="20px" Width="126px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Text="*"  ControlToValidate="txttelephone" 
                ErrorMessage="联系方式不能为空" ValidationGroup="register"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID ="adfas" runat ="server" ErrorMessage ="联系格式不正确" ControlToValidate ="txttelephone" 
                 ValidationExpression ="^((\(\d{3,4}\)|\d{3,4}-)?\d{8})$|^(\d{11})$" Text ="*" ValidationGroup="register"></asp:RegularExpressionValidator>
                    
                </td>
        </tr>
        
        <tr>
            <td class="ta2 tag">
                管理员类型：</td>
            <td class="ta2">
            <asp:DropDownList ID="rbtnListType" runat="server" onchange="ddlChanged();"  
                    CssClass="inp2" Height="24px" Width="126px" >
                                <asp:ListItem Value="0">运营商管理员</asp:ListItem>
                                <asp:ListItem Value="1">学校管理员</asp:ListItem>
                                 <asp:ListItem Value="2">课程内务</asp:ListItem>
                                <asp:ListItem Value="3">招生负责人</asp:ListItem>
                                 <asp:ListItem Value="4">网站编辑</asp:ListItem>
                            </asp:DropDownList>
        </tr>
        
        <tr id="trc" runat="server"><td class="ta2 tag">隶属学校</td><td class="ta2">
                            <asp:DropDownList ID="ddlSchoolList" runat="server"  CssClass="inp2" 
                                Enabled="false" Height="22px" Width="126px" >
                            </asp:DropDownList>
                            </td></tr>
       <p >
       <span id="AuthSpan" style="color:Red;font-size:small" ></span></p>
                
        <tr><td class="ta2 tag">启用</td><td class="ta2">
                            <asp:CheckBox ID="chkIsEnable" runat="server" Checked="true" />
                            </td></tr>
        <tr ><td  class="ta2" colspan="2" align="left"><asp:Button ID="btnadd" runat="server" Text="添加" CssClass="button" 
         OnClick="btnRegister_Click"  ValidationGroup="register"   />&nbsp;&nbsp;<input type="button" onclick="this.form.reset(); " value="重置" class="button"  id="btnReset" runat="server"/><asp:HiddenField
             ID="AddOrNot" runat="server" />
        </td></tr>
    </table>
    <p style="color:Red; text-align:left"><asp:Label ID="lblMess" runat="server"></asp:Label></p>
   <p style="margin-left:50px"><asp:ValidationSummary ID="validSummary" runat="server"   HeaderText="错误信息" ValidationGroup="register" Height="194px" /> </div>
    </div>
    </form>
</body>
</html>
